package com.ycp.erp.printer.ui.activity;

import android.annotation.SuppressLint;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.jakewharton.rxbinding2.view.RxView;
import com.one.common.config.RouterPath;
import com.one.common.manager.RouterManager;
import com.one.common.view.base.BaseActivity;
import com.one.common.view.widget.ClearEditView;
import com.one.common.view.widget.MyTitleBar;
import com.ycp.erp.R;
import com.ycp.erp.warehouse.model.extra.WarehouseExtra;

import java.util.concurrent.TimeUnit;

import butterknife.BindView;

/**
 * Class Des:新增打印机
 * Created by bjh on 2021/9/8.
 */
@Route(path = RouterPath.ADD_PRINTER)
public class AddPrinterActivity extends BaseActivity {
    @BindView(R.id.tvWarehouseName)
    ClearEditView tvWarehouseName;
    @BindView(R.id.tvSelectPDate)
    TextView tvSelectPDate;
    @BindView(R.id.rlSelectPDate)
    RelativeLayout rlSelectPDate;
    @BindView(R.id.etSortValue)
    ClearEditView etSortValue;
    @BindView(R.id.llTop)
    LinearLayout llTop;
    @BindView(R.id.tvSerialNumber)
    ClearEditView tvSerialNumber;
    @BindView(R.id.ctLabel)
    ClearEditView ctLabel;
    @BindView(R.id.etFlowNo)
    ClearEditView etFlowNo;
    @BindView(R.id.tvSubmit)
    TextView tvSubmit;

    @Override
    protected void initPresenter() {

    }

    @Override
    public int getLayoutResId() {
        return R.layout.activity_add_printer;
    }

    @Override
    protected void initTitle() {
        super.initTitle();
        getMyTitleBar().setMode(MyTitleBar.Mode.BACK_TITLE)
                .setTitleText("新增打印机").hideLine();
    }

    @SuppressLint("CheckResult")
    @Override
    public void initView() {
        super.initView();
        RxView.clicks(tvSubmit).throttleFirst(500, TimeUnit.MILLISECONDS).subscribe(o->{
            RouterManager.getInstance().go(RouterPath.WAREHOUSE_SUCCESS, new WarehouseExtra("添加成功", "添加打印机成功"));
        });
    }
}
